package cn.apthink.calendar;

import java.util.ArrayList;
import java.util.List;

import cn.apthink.utility.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class WeekTemplateDetail {
	private String weekId;
	private int dayIndex;
	private int startSecond;
	private int endSecond;
	private boolean overtime;
			
	public WeekTemplateDetail(String id, int dayIndex, String start, String end, boolean isOvertime) {
		this.weekId = id;
		this.dayIndex = dayIndex;
		this.startSecond = DateUtil.Time2Second(start);
		this.endSecond = DateUtil.Time2Second(end);
		this.overtime = isOvertime;
	}
	
	public WeekTemplateDetail(String id, int dayIndex, String start, String end) {
		this.weekId = id;
		this.dayIndex = dayIndex;
		this.startSecond = DateUtil.Time2Second(start);
		this.endSecond = DateUtil.Time2Second(end);
		this.overtime = false;
	}

	public static List<WeekTemplateDetail> testData() {
		List<WeekTemplateDetail> ws = new ArrayList<WeekTemplateDetail>();
		ws.add(new WeekTemplateDetail("week-template-default", 1, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-template-default", 1, "13:00", "17:00"));
		ws.add(new WeekTemplateDetail("week-template-default", 2, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-template-default", 2, "13:00", "17:00"));
		ws.add(new WeekTemplateDetail("week-template-default", 3, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-template-default", 3, "13:00", "17:00"));
		ws.add(new WeekTemplateDetail("week-template-default", 4, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-template-default", 4, "13:00", "17:00"));
		ws.add(new WeekTemplateDetail("week-template-default", 5, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-template-default", 5, "13:00", "17:00"));
		return ws;
	}
	
	public static List<WeekTemplateDetail> testDatas() {
		//David: 测试数据务必加上缺省模板设置
		List<WeekTemplateDetail> ws = testData();
		ws.add(new WeekTemplateDetail("week-test", 1, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-test", 1, "13:00", "17:00"));
		ws.add(new WeekTemplateDetail("week-test", 1, "19:00", "21:00", true));
		ws.add(new WeekTemplateDetail("week-test", 2, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-test", 2, "13:00", "17:00"));
		ws.add(new WeekTemplateDetail("week-test", 2, "19:00", "21:00", true));
		ws.add(new WeekTemplateDetail("week-test", 3, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-test", 3, "13:00", "17:00"));
		ws.add(new WeekTemplateDetail("week-test", 3, "19:00", "21:00", true));
		ws.add(new WeekTemplateDetail("week-test", 4, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-test", 4, "13:00", "17:00"));
		ws.add(new WeekTemplateDetail("week-test", 4, "19:00", "21:00", true));
		ws.add(new WeekTemplateDetail("week-test", 5, "08:00", "12:00"));
		ws.add(new WeekTemplateDetail("week-test", 5, "13:00", "17:00"));
		ws.add(new WeekTemplateDetail("week-test", 6, "08:00", "12:00", true));
		ws.add(new WeekTemplateDetail("week-test", 6, "13:00", "17:00", true));
		return ws;
	}
}
